package com.zyg.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zyg.pojo.Grade;
import com.zyg.pojo.Team;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface TeamMapper extends BaseMapper<Team> {
    @Override
    @Select("select team_id,team_name,grade_id from sys_team ${ew.customSqlSegment}")
    @Results({
            @Result(column = "team_id", property = "teamId"),
            @Result(column = "team_name", property = "teamName"),
            @Result(column = "grade_id", property = "grade", javaType = Grade.class,
                    one = @One(select = "com.zyg.dao.GradeMapper.getGradeById"))
    })
    List<Team> selectList(IPage<Team> page, @Param(Constants.WRAPPER) Wrapper<Team> queryWrapper);
}